<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>宜鲜生</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <!-- load css -->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css?v=v3.3.7" media="all">
    <link rel="stylesheet" type="text/css" href="css/font/iconfont.css?v=1.0.0" media="all">
    <link rel="stylesheet" type="text/css" href="css/layui.css?v=1.0.9" media="all">
    <link rel="stylesheet" type="text/css" href="css/main.css?v1.3.4" media="all">
</head>
<body>
<div class="container-fluid larry-wrapper">
    <!--顶部统计数据预览 -->

    <!--<div class="row">
        <div class="col-xs-12 col-md-10" style="margin-bottom: 50px;">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;margin-bottom: 50px;">
                <legend>本月工作完成进度</legend>
            </fieldset>
        <div class="layui-progress layui-progress-big" lay-showPercent="true" lay-filter="demo">
            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
        </div>
        </div>
    </div>-->
    <!--<div class="row">
        <div class="col-xs-12 col-md-6">
            <section class="panel">
                <div class="panel-heading">
                    平台数据统计
                    <a href="javascript:;" class="pull-right panel-toggle"><i class="iconfont">&#xe604;</i></a>
                </div>
                <div class="panel-body">
                    <div class="echarts" id="platform"></div>
                </div>
            </section>
        </div>

        <div class="col-xs-12 col-md-6">

            <section class="panel">
                <div class="panel-heading">
                    管理员数据统计
                    <a href="javascript:;" class="pull-right panel-toggle"><i class="iconfont">&#xe604;</i></a>
                </div>
                <div class="panel-body">
                    <div class="echarts" id="admin"></div>
                </div>
            </section>
        </div>


    </div>-->
    <div class="layui-row layui-col-space30" id="adminPanel" style="display: none">
        <div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
            <section class="panel">
                <div class="symbol bgcolor-blue"> <i class="iconfont">&#xe622;</i>
                </div>
                <div class="value tab-menu">
                    <a href="javascript:;" data-url="module/order.html" data-parent="true"
                       data-title="用户新订单提醒">
                        <i class="iconfont " data-icon='&#xe622;'></i>
                        <h1 id="waitForSendNum">0</h1>
                    </a>
                    <a href="javascript:;" data-url="module/order.html" data-parent="true" data-title="用户新订单提醒">
                        <i class="iconfont " data-icon='&#xe622;'></i><span>用户新订单提醒</span></a>
                    <!--所有待发货订单数量-->
                </div>
            </section>
        </div>
        <div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
            <section class="panel">
                <div class="symbol bgcolor-commred"> <i class="iconfont">&#xe629;</i>
                </div>
                <div class="value tab-menu">
                    <a href="javascript:;" data-url="module/product.html" data-parent="true" data-title="商品库存不足提醒">
                        <i class="iconfont " data-icon='&#xe629;'></i>
                        <h1 id="lowStockNum">0</h1>
                        <!--库存数量小于10的商品数量-->
                    </a>
                    <a href="javascript:;" data-url="module/product.html" data-parent="true" data-title="商品库存不足提醒">
                        <i class="iconfont " data-icon='&#xe629;'></i><span>商品库存不足提醒</span></a>
                </div>
            </section>
        </div>

        <div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
            <section class="panel">
                <div class="symbol bgcolor-yellow"> <i class="iconfont">&#xe61f;</i>
                </div>
                <div class="value tab-menu">
                    <a href="javascript:;" data-url="module/comments.html" data-parent="true" data-title="商品新评价">
                        <i class="iconfont " data-icon='&#xe669;'></i>
                        <h1 id="unreadCommentNum">0</h1>
                    </a>
                    <a href="javascript:;" data-url="module/comments.html" data-parent="true" data-title="商品新评价">
                        <i class="iconfont " data-icon='&#xe669;'></i><span>商品新评价</span></a>
                </div>
            </section>
        </div>

        <div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
            <section class="panel">
                <div class="symbol bgcolor-commred"> <i class="iconfont">&#xe638;</i>
                </div>
                <div class="value tab-menu">
                    <a href="javascript:;" data-url="module/feedback.html" data-parent="true" data-title="意见反馈">
                        <i class="iconfont " data-icon='&#xe669;'></i>
                        <h1 id="unreadFeedbackNum">0</h1>
                    </a>
                    <a href="javascript:;" data-url="module/feedback.html" data-parent="true" data-title="意见反馈">
                        <i class="iconfont " data-icon='&#xe669;'></i><span>新的意见反馈</span></a>
                </div>
            </section>
        </div>
    </div>

    <div class="layui-row layui-col-space30" id="sellerPanel" style="display: none">
        <div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
            <section class="panel">
                <div class="symbol bgcolor-blue"> <i class="iconfont">&#xe622;</i>
                </div>
                <div class="value tab-menu">
                    <a href="javascript:;" data-url="orders.html" data-parent="true" data-title="今日订单数量"><i class="iconfont " data-icon='&#xe622;'></i>
                        <h1 id="ordersNum">0</h1>
                    </a>
                    <a href="javascript:;" data-url="orders.html" data-parent="true" data-title="今日订单数量">
                        <i class="iconfont " data-icon='&#xe622;'></i><span>今日订单数量</span></a>
                </div>
            </section>
        </div>
    </div>
</div>

</body>
<script type="text/javascript" src="js/layui/layui.js"></script>
<!--#include file="common/version.html"-->
<script>
    layui.use(['main']);
    layui.use('jquery', function () {
        var $ = layui.jquery;

        $.post('/education/admin/dashboard', null, function (rs) {
            if (rs.status == 200) {
                var d = rs.data;
                if (d.ordersNum != undefined) {
                    $('#ordersNum').text = d.ordersNum;
                    $('#sellerPanel').show();
                    $('#adminPanel').hide();
                    top.window.seller = 1;
                } else {
                    $('#sellerPanel').hide();
                    $('#adminPanel').show();
                    $('#lowStockNum').text(d.lowStockNum);
                    $('#waitForSendNum').text(d.waitForSendNum);
                    $('#unreadCommentNum').text(d.unreadCommentNum);
                    $('#unreadFeedbackNum').text(d.unreadFeedbackNum);
                    top.window.seller = 0;
                }
            }
        })
 })
</script>

</html>